<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]>
<script type="text/javascript" src="../lib/html5.js"></script>
<script type="text/javascript" src="../lib/respond.min.js"></script>
<script type="text/javascript" src="../lib/PIE_IE678.js"></script>
<![endif]-->
    <link href="../css/H-ui.min.css" rel="stylesheet" type="text/css" />
    <link href="../css/H-ui.admin.css" rel="stylesheet" type="text/css" />
    <link href="../lib/icheck/icheck.css" rel="stylesheet" type="text/css" />
    <link href="../lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />
    <!--[if IE 6]>
<script type="text/javascript" src="../lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->


    <title>流程节点</title>
</head>
<body>
    <div class="pd-10">
        <form id="itemEdit" name="itemEdit" method="post" action="../ashx/spui.ashx" class="form form-horizontal">
            <input type="hidden" class="actionValue" id="editAction" name="action" value="add" />
            <input type="hidden" id="id" name="id" />
            <input type="hidden" id="tablename" name="tablename" value="" />
            <input type="hidden" id="tablemidname" name="tablemidname" value="" />
            <input type="hidden" id="ffback" name="ffback" value="否" />
            <input type="hidden" id="ffnextsel" name="ffnextsel" value="否" />
            <input type="hidden" id="ffnextusersel" name="ffnextusersel" value="否" />
            <input type="hidden" id="ffcanstop" name="ffcanstop" value="否" />
            <input type="hidden" id="ffcandel" name="ffcandel" value="否" />
            <input type="hidden" id="ffdeid" name="ffdeid" value="0" />
            <input type="hidden" id="ffnextname" name="ffnextname" value="" />
            <div class="row cl">
                <label class="form-label col-2">类型：</label>

                <div class="formControls col-3">
                    <span class="select-box">
                        <select class="select" size="1" name="ffntype" id="ffntype">
                            <option value="发起">发起</option>
                            <option value="审核">审核</option>
                            <option value="处理">处理</option>
                            <option value="条件分支">条件分支</option>
                            <option value="自动执行">自动执行</option>
                            <option value="结束">结束</option>
                        </select>
                    </span>
                </div>

                <div class="col-1"></div>
                <label class="form-label col-2">节点名称：</label>
                <div class="formControls col-3">
                    <input type="text" class="input-text" name="ffnname" id="ffnname" nullmsg="不能为空" datatype="*2-16" placeholder="2~16个字符" />
                </div>
                <div class="col-1"></div>
            </div>
            <div class="row cl">
                <label class="form-label col-2">业务状态：</label>
                <div class="formControls col-3">
                    <input type="text" class="input-text" name="ffstatefyw" id="ffstatefyw" nullmsg="不能为空" datatype="*2-8" placeholder="2~8个字符" />
                </div>
                <div class="col-1"></div>
                <label class="form-label col-2">可修改业务：</label>
                <div class="formControls col-3">
                    <span class="select-box">
                        <select class="select" size="1" name="ffcansave" id="ffcansave">
                            <option value="否">否</option>
                            <option value="是">是</option>

                        </select>
                    </span>
                </div>
                <div class="col-1"></div>
            </div>

            <div class="row cl">
                <label class="form-label col-2">下一步：</label>
                <div class="formControls col-3">
                    <span class="select-box">
                        <select class="select" size="1" name="ffnextid" id="ffnextid"></select>
                    </span>
                </div>
                <div class="col-1"></div>
                <label class="form-label col-2">特指人员执行：</label>
                <div class="formControls col-3">
                    <span class="select-box">
                        <select class="select" size="1" name="ffdoonlyuser" id="ffdoonlyuser">
                            <option value="否">不指定</option>
                            <option value="创建人">创建人</option>
                            <option value="提交人">提交人</option>
                        </select>
                    </span>
                </div>
                <div class="col-1"></div>
            </div>
            <div class="row cl">
                <label class="form-label col-2">指定的部门：</label>
                <div class="formControls col-3">
                    <input type="text" class="input-text" name="ffdodep" id="ffdodep" placeholder="为空代表，所有" />
                </div>
                <div class="col-1"></div>
                <label class="form-label col-2">指定的角色：</label>
                <div class="formControls col-3">
                    <!-- <input type="text" class="input-text" name="ffdotitle" id="ffdotitle" placeholder="为空代表，所有" />-->

                    <select id="ffdotitle" name="ffdotitle">
                    </select>

                </div>
                <div class="col-1"></div>
            </div>
            <div class="row cl">
                <label class="form-label col-2">分支条件：</label>
                <div class="formControls col-9">
                    <input type="text" class="input-text" name="ffntypeauto" id="ffntypeauto" placeholder="格式：#if($age >18) 大于是18 #else  小于18 #end" />
                </div>
                <div class="col-1"></div>
            </div>
            <div class="row cl">
                <label class="form-label col-2">条件字段：</label>
                <div class="formControls col-9">
                    <input type="text" class="input-text" name="ffnautofiles" id="ffnautofiles" placeholder="格式：age:yw_fremoney#getminmoney:yw_fminmoney" />
                </div>
                <div class="col-1"></div>
            </div>
            <div class="row cl">
                <label class="form-label col-2">处理页面：</label>
                <div class="formControls col-9">
                    <input type="text" class="input-text" name="ffdourl" id="ffdourl" placeholder="xxx.html 使用默认时，请输入#" />
                </div>
                <div class="col-1"></div>
            </div>
            <div class="row cl">
                <div class="col-7 col-offset-5">
                    <button class="btn btn-primary radius" type="submit" id="btsub1">提交</button>&nbsp;&nbsp;
				<!--<button class="btn btn-secondary radius" type="button" id="btn_reset">重置</button>&nbsp;&nbsp;-->
                    <button onclick="layer_close();" class="btn btn-default radius" type="button">返回</button>
                </div>
            </div>
        </form>
    </div>
    <script src="../hcjsui/Scripts/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="../lib/icheck/jquery.icheck.min.js"></script>
    <script type="text/javascript" src="../lib/Validform/5.3.2/Validform.js"></script>
    <script type="text/javascript" src="../lib/layer/1.9.3/layer.js"></script>
    <script src="../hcjsui/js/_Define.js" type="text/javascript"></script>
    <script type="text/javascript" src="../js/hcui.js"></script>
    <script type="text/javascript" src="../js/hcui_au.js"></script>
    <script type="text/javascript" src="../lib/My97DatePicker/WdatePicker.js"></script>

    <!--以下为多选择下拉ggggggggggggg-->
    <link rel="stylesheet" href="../homepage/css/bootstrap.min.css" type="text/css" />
    <script type="text/javascript" src="../homepage/js/bootstrap.min.js"></script>

    <script type="text/javascript" src="../homepage/js/bootstrap-multiselect.js"></script>
    <link rel="stylesheet" href="../homepage/css/bootstrap-multiselect.css" type="text/css" />
    <!--为多选择下拉eeeeeeeeeeeeeeee-->
    <script type="text/javascript">
        var Mfdeid = 0;
        //加载处理
        function loadin() {
            //$('#ffdotitle').multiselect();
            //$("#ffdotitle").attr("multiple", "multiple");
            //$('#ffdotitle').multiselect({
            //    nonSelectedText: '选择角色',
            //    nSelectedText: '个角色',
            //    buttonWidth: '100%'
            //});
            if (getUrlParam("action") == "add") {
                Mfdeid = getUrlParam("fdeid");
                $("#ffdeid").val(Mfdeid);
            }
            //本页面
            spsetBaseNoBt("hcr_w_next", "id", "hcr_w_next as t", "*", "#tablelist", "hcrain_wf_de_next", "流程节点", "hcrain_wf_de_next");

            Mhcloadback[0] = "fdeid";
            Mhcloadback[1] = "fdotitle";
            hcdosel("RoleID as id,RoleName as name", "sysrolesdic", "", "", "", "roleid", function (data) {
                var products = JSON.parse(data);
                //$.each(objData, function (index, dinfo) {$("#ffdotitle").append('<option value="' + dinfo.id + '">' + dinfo.name + '</option>');});
                var newProducts = new Array();
                var obj = new Object();
                $.each(products, function (index, product) {
                    obj = {
                        label: product.name,
                        value: product.name
                    };
                    newProducts.push(obj);
                });
                $("#ffdotitle").attr("multiple", "multiple");
                $('#ffdotitle').multiselect({
                    nonSelectedText: '选择角色',
                    nSelectedText: '个角色',
                    buttonWidth: '100%'
                });
                $("#ffdotitle").multiselect('dataprovider', newProducts);
                settitleselinfo();
            });


        }
        var Mseltitle;
        //设置下拉选择，重复调用原因，不知谁快
        function settitleselinfo() {
            var ca = Mseltitle.split(',');
            for (var i = 0; i < ca.length; i++) {
                var c = ca[i];
                $('#ffdotitle').multiselect('select', [c]);
            }
        }

        //重写
        function loadback(data) {
            var selid = data["fnextid"];
            Mseltitle = data["fdotitle"];
            //数据加载
            hcdosel("id,fnname as name", "hcr_w_next", "fdeid =" + data["fdeid"], "", "", "id", function (data) {
                SetSelectWithObjIdName("#ffnextid", data);
                $("#ffnextid").val(selid);
            });
            settitleselinfo();
        }

        //重写  提交前数据处理
        function hcrBeforeSub() {
            //var selected = [];
            //$('#ffdotitle option:selected').each(function () {
            //    selected.push([$(this).val()]);
            //});
            $("#ffnextname").val($('#ffnextid option:selected').text());
        }
    </script>
</body>
</html>
